﻿using System;
using System.Drawing;
using TrainSimulator.Interfaces.DataGridView;

namespace TrainSimulator.Interfaces
{
    public delegate void TrackChangeHandler(ITrack track, ITrackEventArgs e);
    public delegate void BlockHandler(ITrack track, ITrackEventArgs e);

    public interface ITrackEventArgs : IEventArgs
    {
        ITrack Track { get; }
        Object OldValue { get; }
        Object NewValue { get; }
    }

    public interface ITrack : IDgvTrack
    {
        event TrackChangeHandler OnChange;
        event BlockHandler OnBlock;

        int ID { get; set; }
        double Length { get; }
        double StartAngle { get; set; }
        double Angle { get; set; }
        string Blocked { get; } // for DataGridView only
        bool IsBlocked { get; set; }
        ITrack NextTrack { get; set; }
        ITrack Previous { get; set; }
        ITrack[] NextTracks { get; }

        Bitmap TrackImage { get; set; }
        PointF StartPoint { get; set; }
        PointF EndPoint { get; set; }

        /// <summary>
        /// Trainset blocking this track
        /// </summary>
        ITrain BlockingTrain { get; set; }
    }
}
